using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class FMS_OperateLogMap : EntityTypeConfiguration<FMS_OperateLog>
	{
		public FMS_OperateLogMap()
		{
			// Primary Key
			this.HasKey(t => t.OperateLogID);

			// Properties
			this.Property(t => t.Operation)
				.IsRequired()
				.HasMaxLength(100);
				
			this.Property(t => t.Operator)
				.IsRequired()
				.HasMaxLength(20);
				
			this.Property(t => t.Description)
				.HasMaxLength(400);
				
			this.Property(t => t.Reasult)
				.IsRequired()
				.HasMaxLength(400);
				
			// Table & Column Mappings
			this.ToTable("FMS_OperateLog");
			this.Property(t => t.OperateLogID).HasColumnName("OperateLogID");
			this.Property(t => t.BizOrderNo).HasColumnName("BizOrderNo");
			this.Property(t => t.LogType).HasColumnName("LogType");
			this.Property(t => t.Operation).HasColumnName("Operation");
			this.Property(t => t.Operator).HasColumnName("Operator");
			this.Property(t => t.OperatorId).HasColumnName("OperatorId");
			this.Property(t => t.OperatorDept).HasColumnName("OperatorDept");
			this.Property(t => t.OperateTime).HasColumnName("OperateTime");
			this.Property(t => t.Description).HasColumnName("Description");
			this.Property(t => t.Reasult).HasColumnName("Reasult");
			this.Property(t => t.Status).HasColumnName("Status");
			this.Property(t => t.IsSyn).HasColumnName("IsSyn");
		}
	}
}

